﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Content/Master.Master" Inherits="System.Web.Mvc.ViewPage<SCS.Core.Models.Collection.ProductPropertiesCollection>" %>
<%@ Import Namespace="SCS.Core" %>
<%@ Import Namespace="SCS.Core.Models" %>
<%@ Import Namespace="SCS.Core.ViewModels" %>
<%@ Import Namespace="SCS.Core.Controllers" %>
<%@ Import Namespace="SCSService" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Chi tiết các thuộc tính sản phẩm
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <!--Editor-->
    <link rel="stylesheet" href="/Editor/themes/default/default.css" />
	<link rel="stylesheet" href="/Editor/plugins/code/prettify.css" />
	<script type="text/javascript" charset="utf-8" src="/Editor/kindeditor.js"></script>
	<script type="text/javascript" charset="utf-8" src="/Editor/lang/en_US.js"></script>
	<script type="text/javascript" charset="utf-8" src="/Editor/plugins/code/prettify.js"></script>
	<script type="text/javascript">
	    KindEditor.ready(function (K) {
	        var editor1 = K.create('#PropertiesDes', {
	            cssPath: '/Editor/plugins/code/prettify.css',
	            uploadJson: '/Editor/asp.net/upload_json.ashx',
	            fileManagerJson: '/Editor/asp.net/file_manager_json.ashx',
	            allowFileManager: true,
	            afterCreate: function () {
	                var self = this;
	                K.ctrl(document, 13, function () {
	                    self.sync();
	                    K('form[name=example]')[0].submit();
	                });
	                K.ctrl(self.edit.doc, 13, function () {
	                    self.sync();
	                    K('form[name=example]')[0].submit();
	                });
	            }
	        });
	        prettyPrint();
	    });
	</script>
    <!--End Editor-->
  <% Html.EnableClientValidation(); %>
  <% using (Html.BeginForm((bool)ViewData["IsAdd"] ? "SaveAddProductTypeProperties" : "SaveEditProductProperties", "Stock", FormMethod.Post, new { id = "sendFileForm", proid = "sendFileForm", typeProperid = "sendFileForm", enctype = "multipart/form-data" }))
            {%>
    <div class="clear"></div>
    <div class="column full">
    <div class="box ">
		<h2 class="box-header"> Tạo sản phẩm chi tiết : <%=ViewData["ProductName"] %> / <%=ViewData["TypePropertiesName"]%></h2>
		<div class="box-content">
             
            <%=Html.HiddenFor(m=>m.PropertiesID) %> 
                                                      
            <label class="form-label"> Tên thuộc tính</label>
            <%=Html.TextBoxFor(m => m.PropertiesName, new { @class = "form-field half" })%> <span style="color:Red;font-weight:bold"><%= Html.ValidationMessageFor(m => m.PropertiesName) %></span>
            <%=Html.HiddenFor(m=>m.ProductTypePropertiesID) %>
            
            <label class="form-label"> Nội dung </label>
            <%= Html.TextAreaFor(m => m.PropertiesDes, new { @class = "form-field full" })%>
            
            <label class="form-label"> Ảnh </label>
                 
                  <%if (Model.Images != null)
                   {
                       string src = Model.Images;
                       
                           %>
                            
                               <img src="http://paynetvn.com/<%=Model.Images %>" width="130px" alt="" id="imgname" onclick="window.open('/Editor/aspnet/Images.aspx','images',' width=750,height=450,left=150,top=200,toolbar=no,status=0,scrollbars=1,location=0,');" />  
                           <%
                   }
                   else
                   { 
                   %>
                    <img src="/Content/images/noimage.gif" width="130px" id="imgname" alt="" onclick="window.open('/Editor/aspnet/Images.aspx','images',' width=750,height=450,left=150,top=200,toolbar=no,status=0,scrollbars=1,location=0,');" />
                    <%   
                   }
                  %> 
                                        
            <label class="form-label"> Trạng thái </label>
            <%
            List<SelectListItem> statusSearch = new List<SelectListItem>();
            statusSearch.AddRange(new SelectListItem[] { 
            new SelectListItem{ Text = "--Chọn trạng thái--",Value="-1"},    
            new SelectListItem{ Text = "Kích hoạt", Value = "1" },
            new SelectListItem{ Text = "Không kích hoạt", Value = "0" }
            });
            %>

            <%=Html.DropDownListFor(m => m.Status, statusSearch, new { onchange = "StatusSelect(this);" })%> 
            <%=Html.HiddenFor(m=>m.Status) %>
                                        
            <p>
                <%=ViewData["Result"]%>
                </p>

           <input type="submit" value="" class="button white_input save_input "/> <!--Button Save-->
                 <a class="button white" href="javascript:history.back();"><span class="icon_text cancel"></span>Đóng</a> <!--Button Close-->
	    </div>
	</div>
    <div class="clear"></div>
    </div>    
<% } %>

</asp:Content>
